    var romanToInt = function (s) {
        let maps = {
            M: 1000,
            CM: 900,
            D: 500,
            CD: 400,
            C: 100,
            XC: 90,
            L: 50,
            XL: 40,
            X: 10,
            IX: 9,
            V: 5,
            IV: 4,
            I: 1
        }

        let i = 0
        let res = 0
        while (s[i]) {
            // M  CM  如果存在cm
            if (maps[s[i] + s[i + 1]]) {
                res += maps[s[i] + s[i + 1]]
                i++
            } else {
                res += maps[s[i]]
            }
            i++
        }

        return res
    };

    console.log('"LVIII" ==> ', romanToInt("LVIII"))